Skip to content

隐藏模块 - HideModule

函数简介

隐藏当前进程中指定的模块,并返回隐藏上下文句柄。

接口名称

HideModule

DLL调用

c
long HideModule(long instance, string moduleName);

参数说明

参数名类型说明
instance长整数型OLAPlug实例指针,由 CreateCOLAPlugInterFace 接口生成。
moduleName字符串模块名称,例如 XXX.dll,仅支持当前进程中已加载的模块。

示例

SDK 调用

cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
long handle = ola.HideModule("XXX.dll");
csharp
using OLAPlug;

var ola = new OLAPlugServer();
long handle = ola.HideModule("XXX.dll");
python
from OLAPlugServer import OLAPlugServer

ola = OLAPlugServer()
handle = ola.HideModule("XXX.dll")
java
import com.olaplug.OLAPlugServer;

OLAPlugServer ola = new OLAPlugServer();
long handle = ola.HideModule("XXX.dll");
cpp
var ola = com("OlaPlug.OlaSoft")
var handle = ola.HideModule("XXX.dll")
vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
handle = ola.HideModule("XXX.dll")
text
.局部变量 ola, OLAPlug
ola.创建 ()
handle = ola.HideModule("XXX.dll")
aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var handle = ola.HideModule("XXX.dll");
text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
长整数 handle = ola.HideModule("XXX.dll")
cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
long handle = ola.HideModule("XXX.dll");

原生 DLL 调用

cpp
long instance = CreateCOLAPlugInterFace();
HideModule(instance, "XXX.dll");
csharp
using System.Runtime.InteropServices;
using System.Text;

[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern long CreateCOLAPlugInterFace();
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern long HideModule(long ola, string moduleName);

long instance = CreateCOLAPlugInterFace();
HideModule(instance, "XXX.dll");
python
from ctypes import CDLL, c_int, c_int64, create_string_buffer

ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
instance = ola.CreateCOLAPlugInterFace()
ola.HideModule(instance, "XXX.dll")

返回值

返回值说明
(返回值)- 成功:返回隐藏上下文句柄(长整数),用于后续调用 UnhideModule 恢复模块。 - 失败:返回 0

注意事项

项目说明
隐藏模块可能会导致未知的问题隐藏模块可能会导致未知的问题,请谨慎使用。
隐藏上下文需在完成后使用 [UnhideModu隐藏上下文需在完成后使用 UnhideModule 释放。